﻿<?php
session_start();
include("common/connect.php");
include("common/common.php");

$userid = isset($_COOKIE["gwt_userid"]) ? $_COOKIE["gwt_userid"] : "";
$zfb = isset($_COOKIE["gwt_zfb"]) ? $_COOKIE["gwt_zfb"] : "";
$phone = isset($_COOKIE["gwt_phone"]) ? $_COOKIE["gwt_phone"] : "";
$email = isset($_COOKIE["gwt_email"]) ? $_COOKIE["gwt_email"] : "";

// Normal
//$count = mysql_num_rows(mysql_query("select id from user where commend_id='".$id."'"));
//$countHasBuy = 0;

$sql ="";
$sql .= "select id,url,title,type from daohang";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="购物兔返利,返利浏览器,返利网,返利,最快的返利网" />     
<meta name="description" content="" /> 
<title>购物兔导航</title>
<link rel="stylesheet" type="text/css" href="css/guid.css" />
<link type="text/css" rel="stylesheet" href="css/global.css" />
<script type="text/javascript" src="css/common.js"></script>
</head>
<body>
<?php
	require("header.php");
	require("hearss.php");
?>

<?PHP
date_default_timezone_set("Asia/Chongqing");
require_once('public/cache.inc.php');
$cachedir = "./cache/";
$cache = new Cache($cachedir, 3600 * 12);	// 12小时
if (isset($_GET["refresh"]))
{
	$url = str_replace("&refresh","",$cache->geturl());
	$cache->clean2($cache->getcacheid2($url));
}

$hitCache = $cache->load();
if (!isset($hitCache) || !$hitCache) {
?>

<div class="item topguid_list">
	<h2>特别推荐</h2>
	<ul>
    <?php 
		$sql = "select * from daohang where pic_url!='' and see>0 order by see limit 6";
		$result = mysql_query($sql);
		while( $result && $row = mysql_fetch_array( $result ))
		{
	?>
    	<li>
            <a class="pic" href="<?php echo $row["url"]; ?>" title="<?php echo $row["title"]; ?>" target="_blank">
            <img src="<?php echo $row["pic_url"]; ?>" width="100" height="45" alt="<?php echo $row["title"]; ?>" /><b class="cover"></b></a>
            <p><a href="<?php echo $row["url"]; ?>" title="<?php echo $row["title"]; ?>" target="_blank"><?php echo $row["title"]; ?></a></p>
        </li>
    <?php
		}
	?>
	</ul>
	<h2 class="guid_list_head"><span>名站名店</span><span class="More"><a href="http://www.gouwutu.com/new/mall/" target="_blank">更多&gt;&gt;</a></span></h2>
    <ul style="overflow:hidden;">
        <?php 
		$sql = "select * from daohang where pic_url!='' and see>10 order by see limit 12";
		$result = mysql_query($sql);
		while( $result && $row = mysql_fetch_array( $result ))
		{
	?>
    	<li>
            <a class="pic" href="<?php echo $row["url"]; ?>" title="<?php echo $row["title"]; ?>" target="_blank">
            <img src="<?php echo $row["pic_url"]; ?>" width="100" height="45" alt="<?php echo $row["title"]; ?>" /><b class="cover"></b></a>
            <p><a href="<?php echo $row["url"]; ?>" title="<?php echo $row["title"]; ?>" target="_blank"><?php echo $row["title"]; ?></a></p>
        </li>
    <?php
		}
	?>
    </ul>
</div>
<div style="width:970px; margin:10px auto; clear:both; overflow:hidden"><a target="_blank" href="http://shop34077179.taobao.com/" title=""><img width="1000" alt="" src="http://123.gouwutu.com/upload/1000x60.jpg"></a></div>
<?php
			$sql = "select zu from daohang group by zu order by zu";
			$result = mysql_query($sql);
			while( $result && $row = mysql_fetch_array( $result ))
			{
				$zu_id = $row["zu"];
?>
<div class="item guid_list">
    <div class="guid_list_head">
    <?php
			if($zu_id == 4)
				echo '<span class="n1">酷站导航</span>·';
			
			$sql = "select type from daohang where zu=$zu_id group by type order by zulei";
			$result2 = mysql_query($sql);
			while( $result2 && $row2 = mysql_fetch_assoc( $result2 ))
			{
				echo '<span>'.$row2["type"].'</span>'; 
			}
    ?>
    <span class="More"><a href="more/index.php?zuid=<?php echo $zu_id; ?>" target="_blank">更多&gt;&gt;</a></span>
    </div>
    <?php
			$sql = "select type from daohang where zu=$zu_id group by type order by zulei";
			$result2 = mysql_query($sql);
			while( $result2 && $row2 = mysql_fetch_assoc( $result2 ))
			{
    ?>
    <div class="guid_list_item">
        <h2><?PHP echo $row2["type"] ?></h2>
        <ul>
        <?php
			$sql = "select * from daohang where zu=$zu_id and type='".$row2["type"]."' and see>0 and pic_url='' order by see limit 8";
			$result1 = mysql_query($sql);
			$i = 0;
			while( $result1 && $row1 = mysql_fetch_assoc( $result1 ))
			{
		?>
				<li><a target="_blank" sid="<?php echo $row1["return"]; ?>" href="<?php if($row1["trade"] == 1 && $row1["judge"] == 1){ echo $row1["url"]; }else if($row1["trade"] == 1){ echo 'http://www.gouwutu.com/new/s/shop.php?nick='.urlencode($row1["url"]); }else{ echo $row1["url"]; } ?>"><?php echo $row1["title"]; ?></a></li> 
		<?php	}
        ?>
        </ul>
    </div>
    
<?PHP
	}
?>
</div>
<?php
}?>

<?php
	require("ft.php");
?>
</body>
</html>
<div align="center"><script src="http://s20.cnzz.com/stat.php?id=3557071&web_id=3557071&show=pic" language="JavaScript"></script></div>

<?PHP
$cache->write();
}
?>